<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <title>个人中心</title>
    <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon"/>

    <link type="text/css" rel="stylesheet" href="/template/default/css/font-awesome.min.css"/>
    <!--<link rel="stylesheet" type="text/css" href="/template/default/recouse/css/fcommom.css?version=20150713">-->
    <link rel="stylesheet" type="text/css" href="/template/default/recouse/css/fd.css">
    <link rel="stylesheet" type="text/css" href="/template/default/css/public.css"/>
    <!--<link rel="stylesheet" type="text/css" href="http://nsr.9hive.cn/global/vendor/layer/mobile/need/layer.css"/>-->


    <link rel="stylesheet" type="text/css" href="/template/default/recouse/css/fcommom.css?version=20150713">

    <script type="text/javascript" src="https://static.9hive.cn/global/vendor/jquery/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="https://static.9hive.cn/global/vendor/layer/layer.js"></script>
    <script src="http://nsr.9hive.cn/global/vendor/jquery_qr/qrcode.js"></script>
    <!--<script type="text/javascript" src="http://nsr.9hive.cn/global/vendor/layer/mobile/layer.js"></script>-->
    <style>
        .foot {
            width: 100%;
            min-width: 300px;
            margin-top: 10px;
            margin-bottom: 30px;
            padding: 10px 0;
            color: #555;
            text-align: center;
        }

        .foot a {
            color: #555;
            margin: 0 3px;
        }

        .icon_i {
            font-size: 21px;
            color: #45a5cf;
        }

        .alert-warning {
            color: #8a6d3b;
            background-color: #fcf8e3;
            border-color: #faebcc;
        }

        .alert {
            font-size: 12px;
            padding: 5px;
            text-align: center;
            /*margin-bottom: 20px;*/
            border: 1px solid transparent;
            border-radius: 4px;
        }

        .alert a {
            color: #8a6d3b;
        }

        a, a:active {
            text-decoration: none;
            color: #8a6d3b;
        }

        .icon-level-p1 {
            height: auto;
        }
    </style>

</head>
<body class="body-gray" style="min-width: 320px;max-width: 640px;margin:0 auto;">
<%if(isNotEmpty(loginMember)){%>
<div class="panel memberhead" style="display: none;">
    <div class="header-l" style="width: 84px">
        <%if(isEmpty(loginMember.headimgurl!)){%>
        <img class="icon-level-p1" src="/template/default/recouse/images/tx.png"/>
        <%}else{%>
        <img class="icon-level-p1" src="${loginMember.headimgurl!}"/>
        <%}%>
    </div>
    <div class="header-r">
        <ul class="distributor-infor">
            <li>
                <%if(isEmpty(loginMember)){%>
                <span class="distributor-infor-label">临时账户</span><span class="distributor-infor-c" style="width:100px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                <%}else{%>
                <span class="distributor-infor-label">用户名：</span>
                <span class="distributor-infor-c">${loginMember.username!}</span>
                <%}%>
            </li>
            <!-- <span class="distributor-infor-label">您的等级：</span>
             <li class="distributor-infor-c">
                 <%if(!isEmpty(loginMember)){%>
                     ${loginMember.memberRank.name!}
                 <%}else{%>
                     非会员
                 <%}%>
             </li>-->


            <%if(!isEmpty(loginMember)){%>
            <li>
                <span class="distributor-infor-label">注册时间:</span><span class="distributor-infor-c">${loginMember.createDate!,dateFormat="yyyy-MM-dd"}</span>
            </li>
            <%}%>
        </ul>

    </div>
</div>
<div class="memberhead_ui">
    <div class="member-photo">
        <%if(isNotEmpty(loginMember)){%>
        <!--<a href="#" class="code_dj my_code">
            <div class="member-photo-left fl" onclick="">
                <i class="iconfont_i"><img class="icon-level-p1" src="/template/default/recouse/images/erwm.png"/></i>
                <span style="font-size: 1.4rem">二维码</span>
            </div>
        </a>-->
        <%if(alreadySign! =="alreadySign"){%>
        <!--<div class="member-photo-right fr" onclick="sign();">
            <i class="iconfont_i"><img class="icon-level-p1" src="/template/default/recouse/images/sch.png"/></i>
            <span class="sign" style="font-size: 1.4rem">已签到</span>
        </div>-->
        <%}else{%>
        <!--<div class="member-photo-right fr" onclick="sign();">
            <i class="iconfont_i"><img class="icon-level-p1" src="/template/default/recouse/images/sch.png"/></i>
            <span class="sign" style="font-size: 1.4rem">签到</span>
        </div>-->
        <%}%>
        <%}%>

        <div class="member-photo-img">
            <%if(isEmpty(loginMember.headimgurl!)){%>
            <img class="icon-level-p1" src="/template/default/recouse/images/get_avatar.png"/>
            <%}else{%>
            <img class="icon-level-p1" src="${loginMember.headimgurl!}"/>
            <%}%>
        </div>
        <div class="member-photo-name">
            <ul class="distributor-infor">
                <li>
                    <%if(isEmpty(loginMember)){%>
                    <span class="distributor-infor-label">临时账户</span><span class="distributor-infor-c"
                                                                           style="width:100px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                    <%}else{%>
                    <span class="distributor-infor-c distributor-infor-ui">${loginMember.username!}</span>
                    <%}%>
                </li>
                <!--<li class="dej">
                    <span class="distributor-infor-label">您的等级：</span>
                    <span class="distributor-infor-c">
                    <%if(!isEmpty(loginMember)){%>
                        ${loginMember.memberRank.name!}
                    <%}else{%>
                        非会员
                    <%}%>
                </li>-->
                <%if(isEmpty(loginMember)){%>
                <li>
                    <a class="login_we" style="color: yellow;"
                       href="/b/customer/wapLogin?shopId=${shopId!}">请先登陆</a></span>
                </li>
                <%}%>
            </ul>
        </div>
    </div>
</div>

<!--head end-->
<div class="my_nav">
    <ul>
        <li class="tiao" id="jdhbarea">
            <a href="/b/customerCenter/capital?shopId=${shopId!}">
                <span id="couponNum">

                    ${loginMember.userBalance.balance!0,orderUnitCurrencyFormat}
                </span>余额
            </a>
        </li>
        <li id="jingDou">
            <a href="javascript:;">
                <span id="jingDouNum">
                    ${loginMember.userBalance.point!0}
                </span>积分
                <input class="balancePoint" type="hidden" value="${loginMember.userBalance.point!0}">
            </a>
        </li>
    </ul>
</div>
<div class="my_menu">
    <div class="menu_title">
        <span class="mu_left"><img src="/template/default/recouse/images/dan.png"/></span>
        <span class="mu_right" style="font-size: 1.4rem">我的订单</span>
    </div>
    <ul>
        <li class="tiao">
            <a href="/b/order/orderListForm?shopId=${shopId!}&type=qbdd" class="menu_1">全部订单</a>
        </li>
        <li class="tiao">
            <a href="/b/order/orderListForm?shopId=${shopId!}&type=dfk" class="menu_2"><span id="payDeaLNum"
                                                                                             style="display: none;"></span>待付款
            </a>
        </li>
        <li class="tiao">
            <a href="/b/order/orderListForm?shopId=${shopId!}&type=dfh"><span style="display: none;"></span>待发货
            </a>
        </li>
        <li class="tiao">
            <a href="/b/order/orderListForm?shopId=${shopId!}&type=dsh" class="menu_3"><span
                    style="display: none;"></span>待收货
            </a>
        </li>

        <li class="tiao">
            <a href="/b/order/orderListForm?shopId=${shopId!}&type=thh" class="menu_4">退换货</a>
        </li>
    </ul>
</div>
<div class="panel member-nav">
    <ul class="side-nav">
        <li><a href="/b/cartItem/list?shopId=${shopId!}">&nbsp;&nbsp;
            <i class="icon-shopping-cart icon_i"></i>&nbsp;<span class="text">购物车</span><i class="arrow"></i></a></li>
        <li><a href="/b/receiver/list?path=${base!}&shopId=${shopId!}">&nbsp;&nbsp;
            <i class="icon-book icon_i icon_i_y"></i>&nbsp;<span class="text">管理收货地址</span><i class="arrow"></i></a>
        </li>
        <li><a href="/b/tocashing/edit?shopId=${shopId!}">&nbsp;&nbsp;
            <i class="icon-credit-card icon_i"></i>&nbsp;<span class="text">余额提现</span><i class="arrow"></i></a></li>
    </ul>

</div>
<%}%>

<div class="panel member-nav">
    <ul class="side-nav">
        <%if(isNotEmpty(loginMember)){%>
        <li>
            <a href="#" class="my_code" id="mycode">&nbsp;&nbsp;<i class="icon-qrcode icon_i"></i>&nbsp;<span
                    class="text">一键推广</span><i class="arrow"></i></a>
        </li>
        <li>
            <a href="/b/profile/recommend?shopId=${shopId!}&type=1">&nbsp;&nbsp;<i
                    class="icon-leaf  icon_i icon_i_y"></i>
                <span class="text">我的推荐<span style="color: #0000cc" id="recommendNum">(0)</span></span><i
                        class="arrow"></i>
            </a>
        </li>
        <li>
            <a href="/b/agent/indexAgent">&nbsp;&nbsp;<i
                    class="icon-leaf  icon_i icon_i_y"></i>
                <span class="text">我是代理</span><i class="arrow"></i>
            </a>
        </li>

        <li><a href="/b/favorite/list?shopId=${shopId!}&type=help">&nbsp;&nbsp;<i
                class="icon-heart icon_i icon_i_r"></i>&nbsp;<span class="text">我的收藏</span><i class="arrow"></i></a>
        </li>
        <%if(browserType! !="weixinBrowser"){%>
        <li><a href="/b/password/edit?shopId=${shopId!}">&nbsp;&nbsp;<i class="icon-key icon_i icon_i_b"></i>&nbsp;<span
                class="text">修改密码</span><i class="arrow"></i></a>
        </li>
        <%}%>
        <%}else{%>
        <li>
            <a href="/b/customer/wapLogin?shopId=${shopId!}">&nbsp;&nbsp;<i class="icon-user icon_i"></i>&nbsp;<span
                    class="text">用户登录</span><i class="arrow"></i>
            </a>
        </li>
        <li>
            <a href="/b/customer/wapRegister?shopId=${shopId!}">&nbsp;&nbsp;<i
                    class="icon-user-md icon_i"></i>&nbsp;<span class="text">用户注册</span><i class="arrow"></i>
            </a>
        </li>
        <%}%>


    </ul>
</div>
<%include("footer_sys.html"){}%>
</body>
<script>

    $(document).on('click', '#mycode', function () {
        layer.open({
            // title: '',
            type: 1,
            anim: 'up',
            content: '<div class="bak_co">'
            + '<div class="txbu"><span class="bak_tx"><img src="${loginMember.headimgurl!}"/></span><span class="ueser_n">${loginMember.username!}</span></div>'
            + '<div class="qrcode">'
            + '<img src="/template/wap4/recouse/images/1.jpg">'
            + '<img class="qrcode_y" src="/b/customerCenter/recommendQrcode/${loginMember.code!}">'
            + '</div>'
            + '<div class="qrcode_cr">'
            + '<div class="ca_text"><span class=""></span>—&nbsp;长按二维码，分享朋友注册—<span class=" "></span></div>'
            + '</div>'
            + '</div>'
        });
    });
    //</br>
</script>
<script type="text/javascript">
    function toast(msg) {
        layer.open({
            content: msg
            , skin: 'msg',
            anim: 'scale'
            , time: 2 //2秒后自动关闭
        });
    }

    <%
    if (isNotEmpty(loginMember)) {%>
        $(function () {
            $.post('/b/profile/allRecommend?shopId=${shopId!}', null, function (e) {
                if (e.code == 0) {
                    $('#recommendNum').html("(" + e.desc + ")");
                }
            })
        });


        function sign() {
            var shopId = "${shopId!}";
            var sign = $(".sign").text();
            if (sign == '已签到') {
                toast("亲,您今天已经签到啦!");
                return;
            }
            $.ajax({
                url: "/b/userSign/sign",
                type: 'GET',
                data: {
                    "shopId": shopId,
                },
                success: function (data) {
                    if (data.code == 1) {
                        toast(data.desc)
                    } else if (data.code == 0) {
                        toast("恭喜您签到成功");
                        $(".sign").text("已签到");
                        var balancePoint = $(".balancePoint").val();
                        $("#jingDouNum").text(parseInt(balancePoint) + data.data.addPoint);
                        //window.location.reload();
                    }
                }
            });
        }

    <%
    }
    %>
</script>
<script>
    /*$('.my_code').on('click', function(){
       layer.open({
           title: false,
           type: 1,
           content: '<div class="bak_co" style="padding: 0" id="code"></div>' +
           '<div class="ca_text">—&nbsp;长按二维码，分享朋友注册—</div>'
       });
           $(window.document).find("#code").qrcode({
               render: 'image',
               text: utf16to8("${weburl}/b/customer/wapRegisterForm/${loginMember.code!'42777088'}"),
               height: 240,
               width: 240,
               typeNumber: -1,            //计算模式
               correctLevel: QRErrorCorrectLevel.M,//纠错等级
               background: "#ffffff",    //背景颜色
               src: '${loginMember.headimgurl!"http://imgs.weimih.com/plateform/201712/1a0006ba960a49d9985b55ac0001c2a4.jpg"}'
           });
   });*/
    // (function (win,$) {
    //     $("code").qrcode({
    //         render: 'canvas',
    //         text: utf16to8("遠征"),
    //         height: 200,
    //         width: 200,
    //         typeNumber: -1,            //计算模式
    //         correctLevel: QRErrorCorrectLevel.M,//纠错等级
    //         background: "#ffffff",    //背景颜色
    //         src: 'http://nsr.9hive.cn/global/img/wjg.png'
    //     });
    // })(window,jQuery);

    function utf16to8(str) { //转码
        var out, i, len, c;
        out = "";
        len = str.length;
        for (i = 0; i < len; i++) {
            c = str.charCodeAt(i);
            if ((c >= 0x0001) && (c <= 0x007F)) {
                out += str.charAt(i);
            } else if (c > 0x07FF) {
                out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
                out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
                out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
            } else {
                out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
                out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
            }
        }
        return out;
    }
</script>
</html>
